<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css"/>
        <title>Tane - Hide Delegate - Definition</title>
    </head>
    <body>
    	<h1>Hide Delegate - Definition</h1>
    	<p>In <i>Refactoring: Improving the Design of Existing Code</i>&nbsp;(<a
    		href="http://www.amazon.co.uk/exec/obidos/redirect?link_code=ur2&tag=lancewalton-21&camp=1634&creative=6738&path=http%3A%2F%2Fwww.amazon.co.uk%2Fgp%2Fproduct%2F0201485672"
    		title="Refactoring book at amazon.co.uk"><img src="../images/uk.gif"/></a>&nbsp;<a
    		href="http://www.amazon.com/exec/obidos/ASIN/0201485672" title="Refactoring book at amazon.com"><img src="../images/us.gif"/></a>),
    		<a href="http://martinfowler.com/" title="Martin Fowler's homepage">Martin Fowler</a> describes the problem and solution for the
    		Hide Delegate refactoring thus (pp. 157):</p>
    	<div class="blockquote">
	    	<i>A client is calling a delegate class of an object.</i>
			</br>&nbsp;
			</br><b>Create methods on the server to hide the delegate.</b>
    	</div>
    	<p>Here are some <a href="http://www.refactoring.com/catalog/hideDelegate.html" title="Class diagrams">class diagrams</a> showing the
    	situation before and after the refactoring is applied.</p>
    	<p>The effect of this is to reduce coupling, abstract behaviour, reduce the use of state based metaphors and focus on message passing
    		by pushing a Demeter violating chain of method calls into a more appropriate class.</p>
    		
    	<hr/>
    	<div class="attribution">
    		This plugin is provided by <a href="http://www.stateofflow.com" title="State Of Flow homepage">State Of Flow</a>
    	</div>
    </body>
</html>